/**
 * 
 */
package homework5;

import java.util.LinkedList;

/**
 * @author Nican
 * 
 */
public class Graph {

	LinkedList<Node> nodes = new LinkedList<Node>();
	
	/**
	 * Returns all the subgraphs in this graph
	 * @return
	 */
	public LinkedList<LinkedList<String>> getNetworks() {
		return new NetworkFinder(this).finalSubGraphs();		
	}
	
	/**
	 * Returns the list of citypairs that are necessary to make one connected graph
	 * @return
	 */
	public LinkedList<CityPair> newFlights(){
		
		return new NewFlights(this).getNewFlights();
		
	}
	
	/**
	 * Creates a new city, add it to the graph
	 * @param name
	 * @return return the new city
	 */
	public Node newCity( String name ){
		
		Node city = new Node( name );
		
		nodes.add(city);
		
		return city;
		
	}

}
